<template>
  <view>
    <uni-forms
      class="layout-custom-input-style"
      ref="baseForm"
      :modelValue="baseFormData"
      :rules="rules"
    >
      <uni-forms-item label="姓名姓名:" name="name">
        <uni-easyinput
          class="aa"
          v-model="baseFormData.name"
          placeholder="请输入姓名"
          :disabled="false"
        />
      </uni-forms-item>
      <!-- <button type="primary" @click="submit">提交</button> -->
    </uni-forms>
  </view>
</template>

<script>
export default {
  data() {
    return {
      baseFormData: {
        name: "",
      },
      rules: {
        name: {
          rules: [
            {
              required: true,
              errorMessage: "姓名不能为空",
            },
          ],
        },
      },
    };
  },
  methods: {
    async submit() {
      try {
        await this.$refs.baseForm.validate();
        console.log(1);
      } catch (error) {
        console.log(error);
      }
    },
  },
};
</script>

<style lang="scss" >
</style>